package com.fusion.lottery.auth.service;

import com.fusion.lottery.entity.auth.Authorization;
import com.fusion.lottery.entity.auth.Role;
import com.fusion.utils.json.Msg;

public interface RoleService {
	
	/**
	 * 查询角色
	 * @param role
	 * @param start
	 * @param pageSize
	 * @return
	 */
	public Msg list(Role role,long start,long pageSize);
	
	/**
	 * 查询角色
	 * @param id
	 * @return
	 */
	public Msg get(long id);
	
	/**
	 * 添加角色
	 * @param role
	 * @return
	 */
	public Msg add(Role role);
	
	/**
	 * 更新角色信息
	 * @param role
	 * @return
	 */
	public Msg update(Role role);
	
	/**
	 * 删除角色
	 * @param id
	 * @return
	 */
	public Msg delete(long id);
	
	/**
	 * 获取角色权限
	 * @param roleId
	 * @return
	 */
	public Msg getPermission(long roleId);
	
	/**
	 * 获取角色下的用户
	 * @param roleId
	 * @return
	 */
	public Msg getUser(long roleId);
	
	/**
	 * 给用户分配角色
	 * @param authorization
	 * @return
	 */
	public Msg grantRole(Authorization authorization);
	
	/**
	 * 回收用户角色
	 * @param authorization
	 * @return
	 */
	public Msg recoverRole(Authorization authorization);
	
	/**
	 * 给角色分配权限
	 * @param authorization
	 * @return
	 */
	public Msg grantPermission(long roleId,String sourceIds);

}
